<?php


namespace apps\marriage\core\model;


use vm\com\BaseModel;

class PlatformAccount extends BaseModel
{
    public function incAllMoney($money)
    {
        return $this->where('keyname', '=', 'platform')
            ->setInc('all_money', $money);
    }

    public function incRemainingMoney($money)
    {
        return $this->where('keyname', '=', 'platform')
            ->inc('remaining_money', $money)
            ->inc('all_money', $money)
            ->update();
    }

    public function decRemainingMoney($money)
    {
        return $this->where('keyname', '=', 'platform')
            ->setDec('remaining_money', $money);
    }
}